package com.li.factorypattern.SimpleFactory;

/**
 * @author lirenchun
 */
public class UserFactory {

    public UserModel produce(Integer type) {
        if (type == 1) {
            return new Student();
        } else if (type == 2) {
            return new Teacher();
        } else {
            return null;
        }
    }
}
